#!/usr/bin/perl
# trapremove.cgi

require 'snmp-lib.pl';

&header($text{'traprev_title'}, "", "trapremove", undef, 1);
#print "<hr>";

##get the trap list
my $fileContent = &ReadConfFile();
my @traplist=();
for(my $i=0; $i < @$fileContent; $i++)
{
	my $entry = $fileContent->[$i];
	if($entry =~ /^trapsink ([\.\d]+) (\w+)/)
	{
		push(@traplist, $1);
	}

}

#remove trap receiver
print "<form name=rev method=post action=revtrap.cgi>";
print "<p><BR>$text{'host_name'}:  ";
print "<select name=hostName size=1>";
for my $i (@traplist)
{
	print "<option value=$i>$i</option>";
}
print	"</select></p>";

print "<p><input type=submit class=button1 value=$text{'remove'}></p>";
print "</form>";

#print "<hr>";
&footer("/ucd-snmp/",$text{'index_title'});

